/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.base.dao;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.base.entity.StoreCardTemplateProductDetail;

/**
 * 产品充值卡模板产品DAO接口
 * @author liujiang
 * @version 2013-11-03
 */
public interface StoreCardTemplateProductDetailDao extends StoreCardTemplateProductDetailDaoCustom, CrudRepository<StoreCardTemplateProductDetail, Long> {
	@Query("from StoreCardTemplateProductDetail where SCTP_ID = ?1 AND PRODUCT_ID = ?2")
	public StoreCardTemplateProductDetail findByPK(Long tid, Long pid);
	@Modifying
	@Query("delete from StoreCardTemplateProductDetail s where s.storeCardTemplateProduct.id = ?1 AND s.storeProduct.id = ?2")
	public void delete(Long tid, Long pid);
}

/**
 * DAO自定义接口
 * @author liujiang
 */
interface StoreCardTemplateProductDetailDaoCustom extends BaseDao<StoreCardTemplateProductDetail> {

}

/**
 * DAO自定义接口实现
 * @author liujiang
 */
@Component
class StoreCardTemplateProductDetailDaoImpl extends BaseDaoImpl<StoreCardTemplateProductDetail> implements StoreCardTemplateProductDetailDaoCustom {

}
